package com.zhx.common;


import com.zhx.common.common.annotation.RateLimit;
import com.zhx.common.common.annotation.RateLimits;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class testRateLimit {
    @Test
    @RateLimits(
            @RateLimit(time = 1, count = 1)
    )
    public void test() throws InterruptedException {
        while(true){
            test2();
            Thread.sleep(900);
        }
    }


    @RateLimits(
            @RateLimit(time = 1, count = 1)
    )
    public void test2() {
        System.out.println("test2");
    }
}
